#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int* p1 = (int*)malloc(10 * sizeof(int));
	if (p1 == NULL)
	{
		return 1;
	}
	for (int i = 0; i < 10; i++)
	{
		 *(p1 + i)=i;
	}
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", *(p1 + i));
	}
	printf("\n");
	free(p1);
	p1 = NULL;
	int* p2 = (int*)calloc(10, sizeof(int));
	if (p2 == NULL)
	{
		return 1;
	}
	for (int i = 0; i < 10; i++)
	{
		*(p2 + i) = i;
	}
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", *(p2 + i));
	}
	printf("\n");
	int* str = (int*)realloc(p2, 20*sizeof(int));
	if (str != NULL)
	{
		p2 = str;
	}
	for (int i = 0; i < 20; i++)
	{
		*(p2 + i) = i;
	}
	for (int i = 0; i < 20; i++)
	{
		printf("%d ", *(p2 + i));
	}
	free(p2);
	p2 = NULL;

	return 0;
}